package com.dctp.common.vo.simulate;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

public class SimulateProfitStat implements Serializable{


    private BigDecimal totalPnl; // 总盈亏
    private BigDecimal dynamicEquity; // 动态权益
    private BigDecimal initEquity; // 初始权益
    private BigDecimal symbolMargin;
    private Map<String, BigDecimal> orderDiffMap;

    public BigDecimal getSymbolMargin() {
        return symbolMargin;
    }

    public void setSymbolMargin(BigDecimal symbolMargin) {
        this.symbolMargin = symbolMargin;
    }

    public SimulateProfitStat() {
        this.totalPnl = BigDecimal.ZERO;
        this.dynamicEquity = BigDecimal.ZERO;
        this.initEquity = BigDecimal.ZERO;
        this.symbolMargin = BigDecimal.ZERO;
        this.orderDiffMap = new HashMap<>();
    }

    public SimulateProfitStat(BigDecimal totalPnl, BigDecimal dynamicEquity, BigDecimal initEquity) {
        this.totalPnl = totalPnl != null ? totalPnl : BigDecimal.ZERO;
        this.dynamicEquity = dynamicEquity != null ? dynamicEquity : BigDecimal.ZERO;
        this.initEquity = initEquity != null ? initEquity : BigDecimal.ZERO;
        this.symbolMargin = BigDecimal.ZERO;
        this.orderDiffMap = new HashMap<>();
    }

    public SimulateProfitStat(BigDecimal totalPnl, BigDecimal dynamicEquity, BigDecimal initEquity, Map<String, BigDecimal> orderDiffMap,BigDecimal symbolMargin) {
        this.totalPnl = totalPnl != null ? totalPnl : BigDecimal.ZERO;
        this.dynamicEquity = dynamicEquity != null ? dynamicEquity : BigDecimal.ZERO;
        this.initEquity = initEquity != null ? initEquity : BigDecimal.ZERO;
        this.symbolMargin = symbolMargin;
        this.orderDiffMap = orderDiffMap != null ? orderDiffMap : new HashMap<>();
    }

    public BigDecimal getTotalPnl() {
        return totalPnl;
    }

    public void setTotalPnl(BigDecimal totalPnl) {
        this.totalPnl = totalPnl;
    }

    public BigDecimal getDynamicEquity() {
        return dynamicEquity;
    }

    public void setDynamicEquity(BigDecimal dynamicEquity) {
        this.dynamicEquity = dynamicEquity;
    }

    public BigDecimal getInitEquity() {
        return initEquity;
    }

    public void setInitEquity(BigDecimal initEquity) {
        this.initEquity = initEquity;
    }

    public Map<String, BigDecimal> getOrderDiffMap() {
        return orderDiffMap;
    }

    public void setOrderDiffMap(Map<String, BigDecimal> diff) {
        this.orderDiffMap = diff != null ? diff : new HashMap<>();
    }

}
